package com.yanxin.credit.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @program jkstack-dpa
 * @description: minio 桶名
 * @author: LiuYanXin
 * @create: 2021-06-15 11:19
 */
@Getter
@AllArgsConstructor
public enum MinioBucketEnum {

    /**
     * 公共桶
     */
    PUBLIC("public"),

    /**
     * 项目资源桶
     */
    CREDIT("credit"),

    ;

    private final String value;


    public static MinioBucketEnum getType(String fileType) {

        if (FilePathEnum.AVATAR.getName().equals(fileType) ||
                FilePathEnum.JMETER.getName().equals(fileType)) {
            return MinioBucketEnum.PUBLIC;
        } else {
            return MinioBucketEnum.CREDIT;
        }
    }
}
